Release 10.1A: OpenEdge Development:
Programming Interfaces
Example 1 — retrieving names and phone numbers
This example retrieves names and phone numbers. It is presented in two versions in the following sections:
Without namespace processing
Here is the EPI SAX Example 1 driver, i-sax1d.p. The driver’s logic closely parallels the tasks in the "Basic tasks of a Progress SAX application" section:
Here is the EPI SAX Example 1 XML file, i-sax1.xml. Each entry contains a name and phone number:
Here is the EPI SAX Example 1 handler procedure, i-sax1h.p (1 of 2). It contains the callbacks:
When Example 1 is run, it produces the trace shown in Table 20–9.
With namespace processing
Here is the same example except that the XML document uses Namespaces. Consequently, the
Note: The original example could have usedStartElementandEndElementcallbacks in the handler use thenamespaceURIandlocalNameparameters rather thanqName.localNameby itself, but did not.Here is the EPI SAX Example 1 driver with namespace processing, i-sax1dn.p:
Here is the EPI SAX Example 1 XML file with namespace processing, i-sax1n.xml:
Here is the EPI SAX Example 1 handler procedure with namespace processing, i-sax1hn.p (1 of 2):
When Example 1 with namespace processing is run, it produces the trace shown in Table 20–10.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |